//File Name: main.cpp
//Author: 
//Mail: 
//Created Time: Sat Apr 29 00:08:33 2017
#include<iostream>
#include<string>
#include<fstream>
using namespace std;

class FileRead
{
public:
    FileRead()=delete;
    FileRead(const string & file):filename(file){}
    ~FileRead(){}
    string read() const;
private:
    string filename;    
};
string FileRead::read() const
{
    fstream f(filename);
    if(!f.is_open())
        return "";
    string tmp;
    string ret="";
    while(getline(f,tmp))
        ret.append(tmp+"\n");
    return ret;
}

int myMain()
{
    string filename;
    cout<<"input filename:";
    cin>>filename;

    FileRead fr(filename);

    string ret=fr.read();
    cout<<ret;

    return 0;
}

int main()
{
    return myMain();
}
